CXX := g++
CXXFLAGS := -std=c++11 -O2 -Wall -I../../include -I.
LDFLAGS := -pthread

# 当前目录下的源文件
HTTP_SRCS := \
    main.cc \
    HttpContext.cc \
    HttpRequest.cc \
    HttpResponse.cc \
    HttpServer.cc \
    Util.cc

# 公共模块目录（source/）下的源文件
COMMON_SRCS := \
    ../../source/Acceptor.cc \
    ../../source/Any.cc \
    ../../source/Buffer.cc \
    ../../source/Channel.cc \
    ../../source/Connection.cc \
    ../../source/EventLoop.cc \
    ../../source/LoopThread.cc \
    ../../source/LoopThreadPool.cc \
    ../../source/NetWork.cc \
    ../../source/Poller.cc \
    ../../source/Socket.cc \
    ../../source/TcpServer.cc \
    ../../source/TimerTask.cc \
    ../../source/TimerWheel.cc \
    ../../source/statu_msg.cc

# 最终可执行文件名
TARGET := server

all: $(TARGET)

$(TARGET): $(HTTP_SRCS) $(COMMON_SRCS)
	$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)

clean:
	rm -f $(TARGET)
